@echo off
echo set sh=WScript.CreateObject("WScript.Shell") >telnet_tmp_1.vbs

echo WScript.Sleep 300 >>telnet_tmp_1.vbs
echo sh.SendKeys "%app_server_user%{ENTER}" >>telnet_tmp_1.vbs
echo WScript.Sleep 300 >>telnet_tmp_1.vbs
echo sh.SendKeys "%app_server_pwd%{ENTER}" >>telnet_tmp_1.vbs
echo WScript.Sleep 300 >>telnet_tmp_1.vbs

echo sh.SendKeys "cd %app_server_home_dir%{ENTER}" >>telnet_tmp_1.vbs
echo WScript.Sleep 300 >>telnet_tmp_1.vbs
echo sh.SendKeys "killall -9 java{ENTER}" >>telnet_tmp_1.vbs
echo WScript.Sleep 300 >>telnet_tmp_1.vbs

echo WScript.Sleep 10000>>telnet_tmp_1.vbs


echo sh.SendKeys "exit{ENTER}" >>telnet_tmp_1.vbs
echo WScript.Sleep 300 >>telnet_tmp_1.vbs
echo sh.SendKeys "quit{ENTER}" >>telnet_tmp_1.vbs
echo WScript.Sleep 300 >>telnet_tmp_1.vbs
echo sh.SendKeys "{ENTER}" >>telnet_tmp_1.vbs
echo WScript.Sleep 300 >>telnet_tmp_1.vbs
@rem echo sh.run "cmd /c tskill telnet" >>telnet_tmp_1.vbs
@rem echo WScript.Sleep 300 >>telnet_tmp_1.vbs
@rem echo sh.run "cmd /c tskill cmd" >>telnet_tmp_1.vbs
@rem echo WScript.Sleep 300 >>telnet_tmp_1.vbs

start telnet %app_server_ip%
cscript telnet_tmp_1.vbs
tskill telnet
del telnet_tmp_1.vbs